package com.qianli.cashmama.trade.common.enums;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/21
 * Time: 上午11:43
 */
public enum UserSnapshotInfoTypeEnum {
    USER_SOCIAL_CONTACT(1, "USER_SOCIAL_CONTACT", "用户的运营商记录ID"),
    USER_INFO(2, "USER_INFO", "用户的通讯录记录ID"),
    USER_BEHAVIOR(3, "USER_BEHAVIOR", "用户设备信息"),
    USER_LON_AND_LAT(4, "USER_LON_AND_LAT", "用户经纬度"),
    USER_AUTH_FACE_LIST(5, "USER_AUTH_FACE_LIST", "用户人脸列表"),
    USER_QUOTA(6, "USER_QUOTA", "用于额度"),
    USER_BANK_INFO(7, "USER_BANK_INFO", "用户银行卡"),
    USER_WIFI_MAP(8, "USER_WIFI_MAP", "用户申请的wifi列表"),
    USER_BASE_SNAP(9, "USER_BASE_SNAP", "用户汇总信息快照");

    private int type;
    private String key;
    private String desc;

    UserSnapshotInfoTypeEnum(int type, String key, String desc) {
        this.type = type;
        this.key = key;
        this.desc = desc;
    }

    public int getType() {
        return type;
    }

    public UserSnapshotInfoTypeEnum setType(int type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public UserSnapshotInfoTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public String getKey() {
        return key;
    }

    public UserSnapshotInfoTypeEnum setKey(String key) {
        this.key = key;
        return this;
    }


    public static UserSnapshotInfoTypeEnum convertByType(int type) {
        UserSnapshotInfoTypeEnum userSnapshotInfoTypeEnum = null;
        for (UserSnapshotInfoTypeEnum riskTypeEnum : UserSnapshotInfoTypeEnum.values()) {
            if (riskTypeEnum.getType() == type) {
                userSnapshotInfoTypeEnum = riskTypeEnum;
                break;
            }
        }

        return userSnapshotInfoTypeEnum;
    }
}
